package com.reebake.ideal.storage.client;

import org.springframework.core.io.Resource;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

public interface FileDownloadClient {

    public default ResponseEntity<Resource> downloadById(String fileDetailId){
        return download(fileDetailId, null, null);
    }

    public default ResponseEntity<Resource> downloadByUrl(String url){
        return download(null, url, null);
    }

    @GetMapping("/download")
    public ResponseEntity<Resource> download(@RequestParam String fileDetailId, @RequestParam String url, @RequestParam String dispositionType);
}
